/*    */ package com.zimbra.cs.redolog.op;
/*    */ 
/*    */ import com.zimbra.cs.mailbox.Mailbox;
/*    */ import com.zimbra.cs.mailbox.MailboxManager;
/*    */ import com.zimbra.cs.mailbox.MailboxOperation;
/*    */ import com.zimbra.cs.redolog.RedoLogInput;
/*    */ import com.zimbra.cs.redolog.RedoLogOutput;
/*    */ import java.io.IOException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class SetFolderUrl
/*    */   extends RedoableOp
/*    */ {
/*    */   private int mFolderId;
/*    */   private String mURL;
/*    */   
/*    */   public SetFolderUrl()
/*    */   {
/* 36 */     super(MailboxOperation.SetFolderUrl);
/* 37 */     this.mFolderId = -1;
/* 38 */     this.mURL = "";
/*    */   }
/*    */   
/*    */   public SetFolderUrl(int mailboxId, int folderId, String url) {
/* 42 */     this();
/* 43 */     setMailboxId(mailboxId);
/* 44 */     this.mFolderId = folderId;
/* 45 */     this.mURL = (url == null ? "" : url);
/*    */   }
/*    */   
/*    */   protected String getPrintableData() {
/* 49 */     StringBuffer sb = new StringBuffer("id=").append(this.mFolderId);
/* 50 */     sb.append(", url=").append(this.mURL);
/* 51 */     return sb.toString();
/*    */   }
/*    */   
/*    */   protected void serializeData(RedoLogOutput out) throws IOException {
/* 55 */     out.writeInt(this.mFolderId);
/* 56 */     out.writeUTF(this.mURL);
/*    */   }
/*    */   
/*    */   protected void deserializeData(RedoLogInput in) throws IOException {
/* 60 */     this.mFolderId = in.readInt();
/* 61 */     this.mURL = in.readUTF();
/*    */   }
/*    */   
/*    */   public void redo() throws Exception {
/* 65 */     Mailbox mbox = MailboxManager.getInstance().getMailboxById(getMailboxId());
/* 66 */     mbox.setFolderUrl(getOperationContext(), this.mFolderId, this.mURL);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/redolog/op/SetFolderUrl.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */